package com.xbb.util;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonInclude(Include.NON_NULL)	//如果该属性为NULL则不参与序列化
public class Result {

	private Integer code = 0;//0成功，1失败
	private String msg = null;//响应失败描述
	private Object data = null;
	private Long count = null;
	
	/**
	 * 状态码和备注
	 * @param code
	 * @param msg
	 */
	public Result(Integer code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}
	
	/**
	 * 状态码和结果数据
	 * @param code
	 * @param data
	 */
	public Result(Integer code, Object data) {
		super();
		this.code = code;
		this.data = data;
	}
	
	/**
	 * 状态码、备注、结果数据
	 * @param code
	 * @param msg
	 * @param data
	 */
	public Result(Integer code, String msg, Object data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
	}
	
	
	/**
	 * 封装layui的结果
	 * @param code
	 * @param msg
	 * @param count
	 * @param data
	 */
	public Result(Integer code, String msg, Long count,Object data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Long getCount() {
		return count;
	}

	public void setCount(Long count) {
		this.count = count;
	}

	
	
}
